import { FC, useState } from "react"
import { Table, Tag, Space } from "antd"
import { ColumnsType } from "antd/es/table"
import styles from "./index.less"

const hospitalizedInformation: FC = () => {

  const [tableScroll, setTableScroll] = useState<number>(500)

  const columns: ColumnsType<any> = [
    {
      title: "序号",
      dataIndex: "id",
      key: "id",
      align: "center",
      width: "57"
    },
    {
      title: "就诊日期",
      dataIndex: "datetime",
      key: "datetime",
      align: "center",
      width: "auto",
    },
    {
      title: "就诊科室",
      dataIndex: "deptName",
      key: "deptName",
      align: "center",
      width: "auto",
    },
    {
      title: "主要诊断",
      dataIndex: "description",
      key: "description",
      align: "center",
      width: "auto",
    },
    {
      title: "诊断代码",
      dataIndex: "descpCode",
      key: "descpCode",
      align: "center",
      width: "auto",
    },
    {
      title: "就诊类型",
      dataIndex: "type",
      key: "type",
      align: "center",
      width: "auto",
    },
    {
      title: "就诊医生",
      dataIndex: "docName",
      key: "docName",
      align: "center",
      width: "auto",
    }
  ]

  const data = [
    {
      id: "1",
      datetime: "20210428",
      deptName: "外科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "马医生"
    },
    {
      id: "2",
      datetime: "20210428",
      deptName: "内科科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "里医生"
    },
    {
      id: "3",
      datetime: "20210428",
      deptName: "儿科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "好医生"
    },
    {
      id: "4",
      datetime: "20210428",
      deptName: "内科科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "里医生"
    },
    {
      id: "5",
      datetime: "20210428",
      deptName: "儿科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "好医生"
    },
    {
      id: "6",
      datetime: "20210428",
      deptName: "内科科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "里医生"
    },
    {
      id: "7",
      datetime: "20210428",
      deptName: "儿科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "好医生"
    },
    {
      id: "8",
      datetime: "20210428",
      deptName: "儿科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "好医生"
    },
    {
      id: "9",
      datetime: "20210428",
      deptName: "内科科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "里医生"
    },
    {
      id: "10",
      datetime: "20210428",
      deptName: "儿科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "好医生"
    },
    {
      id: "11",
      datetime: "20210428",
      deptName: "儿科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "好医生"
    },
    {
      id: "12",
      datetime: "20210428",
      deptName: "儿科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "好医生"
    },
    {
      id: "13",
      datetime: "20210428",
      deptName: "内科科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "里医生"
    },
    {
      id: "14",
      datetime: "20210428",
      deptName: "儿科",
      description: "主要诊断信息",
      descpCode: "c5d45",
      type: 1,
      docName: "好医生"
    },
  ]


  return (
    <div className={styles.tableBox}>
      <Table className={styles.tableItem}
        bordered
        rowKey='id'
        scroll={{ y: tableScroll ? tableScroll : 500 }}
        columns={columns}
        dataSource={data}
        pagination={false} />
    </div>
  )
}

export default hospitalizedInformation